Optimal. Leaf size=85 \[ -\frac {2 b \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2} d}+\frac {a \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3921, 12, 3916,
2738, 214} \begin {gather*} \frac {a \tan (c+d x)}{d \left (a^2-b^2\right ) (a+b \sec (c+d x))}-\frac {2 b \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{d (a-b)^{3/2} (a+b)^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 214
Rule 2738
Rule 3916
Rule 3921
Rubi steps
\begin {align*} \int \frac {\sec ^2(c+d x)}{(a+b \sec (c+d x))^2} \, dx &=\frac {a \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}+\frac {\int \frac {b \sec (c+d x)}{a+b \sec (c+d x)} \, dx}{-a^2+b^2}\\ &=\frac {a \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}-\frac {b \int \frac {\sec (c+d x)}{a+b \sec (c+d x)} \, dx}{a^2-b^2}\\ &=\frac {a \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}-\frac {\int \frac {1}{1+\frac {a \cos (c+d x)}{b}} \, dx}{a^2-b^2}\\ &=\frac {a \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}-\frac {2 \text {Subst}\left (\int \frac {1}{1+\frac {a}{b}+\left (1-\frac {a}{b}\right ) x^2} \, dx,x,\tan \left (\frac {1}{2} (c+d x)\right )\right )}{\left (a^2-b^2\right ) d}\\ &=-\frac {2 b \tanh ^{-1}\left (\frac {\sqrt {a-b} \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2} d}+\frac {a \tan (c+d x)}{\left (a^2-b^2\right ) d (a+b \sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.21, size = 83, normalized size = 0.98 \begin {gather*} \frac {\frac {2 b \tanh ^{-1}\left (\frac {(-a+b) \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}+\frac {a \sin (c+d x)}{(a-b) (a+b) (b+a \cos (c+d x))}}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.12, size = 118, normalized size = 1.39
method | result | size |
derivativedivides | \(\frac {-\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-a -b \right )}-\frac {2 b \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a +b \right ) \left (a -b \right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) | \(118\) |
default | \(\frac {-\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\left (a^{2}-b^{2}\right ) \left (a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-a -b \right )}-\frac {2 b \arctanh \left (\frac {\left (a -b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{\sqrt {\left (a +b \right ) \left (a -b \right )}}\right )}{\left (a +b \right ) \left (a -b \right ) \sqrt {\left (a +b \right ) \left (a -b \right )}}}{d}\) | \(118\) |
risch | \(\frac {2 i \left (b \,{\mathrm e}^{i \left (d x +c \right )}+a \right )}{d \left (a^{2}-b^{2}\right ) \left (a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{i \left (d x +c \right )}+a \right )}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a^{2}-i b^{2}-b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a^{2}-i b^{2}+b \sqrt {a^{2}-b^{2}}}{a \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}\, \left (a +b \right ) \left (a -b \right ) d}\) | \(222\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.91, size = 329, normalized size = 3.87 \begin {gather*} \left [-\frac {{\left (a b \cos \left (d x + c\right ) + b^{2}\right )} \sqrt {a^{2} - b^{2}} \log \left (\frac {2 \, a b \cos \left (d x + c\right ) - {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 2 \, \sqrt {a^{2} - b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) + 2 \, a^{2} - b^{2}}{a^{2} \cos \left (d x + c\right )^{2} + 2 \, a b \cos \left (d x + c\right ) + b^{2}}\right ) - 2 \, {\left (a^{3} - a b^{2}\right )} \sin \left (d x + c\right )}{2 \, {\left ({\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} d\right )}}, -\frac {{\left (a b \cos \left (d x + c\right ) + b^{2}\right )} \sqrt {-a^{2} + b^{2}} \arctan \left (-\frac {\sqrt {-a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) + a\right )}}{{\left (a^{2} - b^{2}\right )} \sin \left (d x + c\right )}\right ) - {\left (a^{3} - a b^{2}\right )} \sin \left (d x + c\right )}{{\left (a^{5} - 2 \, a^{3} b^{2} + a b^{4}\right )} d \cos \left (d x + c\right ) + {\left (a^{4} b - 2 \, a^{2} b^{3} + b^{5}\right )} d}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^{2}{\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 150, normalized size = 1.76 \begin {gather*} -\frac {2 \, {\left (\frac {{\left (\pi \left \lfloor \frac {d x + c}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (-2 \, a + 2 \, b\right ) + \arctan \left (-\frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\sqrt {-a^{2} + b^{2}}}\right )\right )} b}{{\left (a^{2} - b^{2}\right )} \sqrt {-a^{2} + b^{2}}} + \frac {a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - a - b\right )} {\left (a^{2} - b^{2}\right )}}\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.12, size = 92, normalized size = 1.08 \begin {gather*} \frac {2\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a+b\right )\,\left (a-b\right )\,\left (\left (b-a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a+b\right )}-\frac {2\,b\,\mathrm {atanh}\left (\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a-b}}{\sqrt {a+b}}\right )}{d\,{\left (a+b\right )}^{3/2}\,{\left (a-b\right )}^{3/2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________